﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Hangu.WebClient
{
    public class SMS
    {
        /// <summary>
        /// 接收信息手机
        /// </summary>
        public List<string> SMSTo { get; set; }
        public string Message { get; set; }
        private static readonly string User = System.Configuration.ConfigurationManager.AppSettings["SMSUser"];
        private static readonly string PWD = System.Configuration.ConfigurationManager.AppSettings["SMSPWD"];
        public bool Send()
        {
            bool isSuccess = false;
            if (SMSTo != null && SMSTo.Count > 0)
            {
                try
                {
                    new FetiontSMS.sendmsgSoapClient().msg(User, PWD, string.Join(",", SMSTo), Message);
                    isSuccess = true;
                }
                catch
                { }
            }
            return isSuccess;
        }
    }
}